package com.yanqu.road.entity.autodata.hotpotjump.config;

import com.yanqu.road.entity.FieldTypeAnnotation;
import com.yanqu.road.entity.autodata.AutoActivityConfigObject;
import com.yanqu.road.utils.string.StringUtils;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

@FieldTypeAnnotation(tableName = "t_s_activity_hotpotjump_mission")
public class HotpotJumpMissionConfig extends AutoActivityConfigObject {
    @FieldTypeAnnotation(select = true, orderASC = true, isIndex = true)
    private int activityId;
    @FieldTypeAnnotation(desc = "id", isIndex = true)
    private int id;
    @FieldTypeAnnotation(desc = "")
    private int level;
    @FieldTypeAnnotation(desc = "")
    private String param;

    public List<List<Integer>> poolParams = new ArrayList<>();

//    public HotpotJumpMissionConfig(ResultSet rs) throws SQLException {
//        this.activityId = rs.getInt("activityId");
//        this.id = rs.getInt("id");
//        this.level = rs.getInt("level");
//        this.param = rs.getString("param");
//    }

    public int getActivityId() {
        return activityId;
    }

    public int getId() {
        return id;
    }

    public int getLevel() {
        return level;
    }

    public String getParam() {
        return param;
    }

    public void setActivityId(int activityId) {
        this.activityId = activityId;
    }

    public void setId(int id) {
        this.id = id;
    }

    public void setLevel(int level) {
        this.level = level;
    }

    public void setParam(String param) {
        this.param = param;
        List<List<Integer>> result = new ArrayList<>();
        for (String str : param.split("\\|")) {
            result.add(StringUtils.stringToIntegerList(str, ","));
        }
        this.poolParams = result;
    }
}